//
//  WebViewController.m
//  MusicPlayer
//
//  Created by dlios on 15-5-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "WebViewController.h"
@interface WebViewController ()

@end

@implementation WebViewController
- (void)dealloc
{
    [super dealloc];
}
//- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//{
//    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    if (self) {
//        NSArray *arr = self.view.window.subviews;
//        UIView *view = [arr objectAtIndex:1];
//        
//        UIButton *button = [view.subviews objectAtIndex:0];
//        button.alpha = 0;
//        
//        UIButton *button1 = [view.subviews objectAtIndex:1];
//        button1.alpha = 0;
//        
//        UIImageView *imageView = [view.subviews objectAtIndex:2];
//        imageView.alpha = 0;
//        
//        
//        UILabel *label = [view.subviews lastObject];
//        label.alpha = 0;
//        UIImageView *albumImageView = [view.subviews objectAtIndex:3];
//        albumImageView.alpha = 0;
//    }
//    return self;
//}

- (void)loadView
{
    [super loadView];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:(UIBarButtonItemStylePlain) target:self action:@selector(backButton)];
    
    
    UIWebView * webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - self.view.frame.size.height / 667 * 64)];
    [self.view addSubview:webView];
    
    
    NSURL * url = [NSURL URLWithString:self.webString];
    NSURLRequest * request = [[NSURLRequest alloc] initWithURL:url];
    [webView loadRequest:request];
}

- (void)backButton
{
    [self.navigationController popToRootViewControllerAnimated:YES];
    // 点击进入到播放界面后，移除底部播放状态条
    NSArray *arr = self.view.window.subviews;
    UIView *view = [arr objectAtIndex:1];
    view.alpha = 1;
    
    UIButton *button = [view.subviews objectAtIndex:0];
    [button setImage:[UIImage imageNamed:@"play.ico"] forState:UIControlStateNormal];
    button.alpha = 1;
    
    UIButton *button1 = [view.subviews objectAtIndex:1];
    button1.alpha = 1;
    
    UIImageView *imageView = [view.subviews objectAtIndex:2];
    imageView.alpha = 1;
    
    
    UILabel *label = [view.subviews lastObject];
    label.alpha = 1;
    UIImageView *albumImageView = [view.subviews objectAtIndex:3];
    albumImageView.alpha = 1;

}

@end
